#!/usr/bin/env bash

LOG_DIR="ws-admin"
NAME="admin"
echo "=================START REDEPLOY ${NAME}================="

PID=$(ps -ef|grep "${NAME}-1.0.jar" | grep -v grep | awk '{print $2}')

echo "=================START KILL PID: ${PID}================="
kill -9 ${PID}

echo "=================BEGIN START ${NAME} SERVER================="
nohup java -jar /server/jar/${NAME}-1.0.jar -Xms128m -Xmx512m &
echo "=================${NAME} SERVER RUNNING================="

tail -fn100 /server/logs/${LOG_DIR}/ws-${NAME}.log
